package com.lwx.chapter9;

public class Main {
    public static void main(String[] args) {
//        Integer[] nums = {1,2,3,4,5,6};
//        SegmentTree<Integer> segTree = new SegmentTree<>(nums, (a ,b) ->(a+b));
//        System.out.println(segTree);
//        System.out.println(segTree.query(0, 5));
        int[] nums2 = {1,2,3,4,5,6};
        NumArray2 numArray2 = new NumArray2(nums2);
        System.out.println(numArray2.sumRange(0,2));
    }
}
